package site.timers.chat.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import site.timers.chat.pojo.dto.LoginDto;
import site.timers.chat.pojo.vo.LoginVo;
import site.timers.chat.service.UserService;

/**
 * @Classname AuthController
 * @Description TODO
 * @Version 1.0.0
 * @Date 2025/8/14 13:38
 * @Author twl
 */
@RequestMapping("/auth")
@RestController
public class AuthController {

    @Autowired
    private UserService userService;

    @PostMapping("/login")
    public LoginVo login(@RequestBody @Validated LoginDto loginDto) {
        return userService.login(loginDto);
    }
}
